package com.aisile.model.goods.pojos;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 *
 * indexName  索引库名称
 * shards = 1 分片1
 * replicas = 0 副本0
 * @Auther:yry
 * @Date:2024/6/11 0011
 * @VERSON:1.0
 */
@Data
@Document(indexName = "bianlidian_info",type = "doc",shards = 1,replicas = 0)
public class GoodsES {

    @Id
    private String id;

    /**
     * 分词器两种模式
     * 1. 细粒度分词 ik_max_word
     * 2. 粗粒度分词 ik_smart
     */
    @Field(searchAnalyzer = "ik_smart",analyzer = "ik_max_word",index = true,type = FieldType.Text)
    private String name;

    @Field(index = true,type = FieldType.Keyword)
    private String goodsNo;

    @Field
    private double price;

    @Field
    private Integer num;

    @Field(type = FieldType.Date)
    private Long createTime;

    /**
     * 分类id
     */
    @Field(type = FieldType.Keyword)
    private String cid;
    /**
     * 分类名称
     */
    @Field(type = FieldType.Keyword)
    private String cname;


}
